﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DAL
{
    public static class GetMark
    {
        #region Get Marks
        static testdbsEntities ctx = new testdbsEntities();
            public static List<Mark> GetMarks()
	        {
	            
	            
	                IQueryable<Mark> tMark = from cs in ctx.Mark
	                                         select cs;
	                return tMark.ToList();
	            
	        }
	
	        public static List<Mark> GetMarksById(int mId)
	        {
	            
	            
	                IQueryable<Mark> tMark = from cs in ctx.Mark
	                                         where cs.id_mark == mId
	                                         select cs;
	                return tMark.ToList();
	            
	        }
	
	        public static List<Mark> GetMarksByMim(int mMin)
	        {
	            
	            
	                IQueryable<Mark> tMark = from cs in ctx.Mark
	                                         where cs.min == mMin
	                                         select cs;
	                return tMark.ToList();
	            
	        }
	
	        public static List<Mark> GetMarksByMax(int mMax)
	        {
	            
	            
	                IQueryable<Mark> tMark = from cs in ctx.Mark
	                                         where cs.max == mMax
	                                         select cs;
	                return tMark.ToList();
	            
	        }
	
	        public static List<Mark> GetMarksByDescr(string mDescr)
	        {
	            
	            
	                IQueryable<Mark> tMark = from cs in ctx.Mark
	                                         where cs.desr  == mDescr
	                                         select cs;
	                return tMark.ToList();
	            
	        }
	
	        public static List<Mark> GetMarksByDescrContains(string mDescr)
	        {
	            
	            
	                IQueryable<Mark> tMark = from cs in ctx.Mark
	                                         where cs.desr.Contains("%/"+mDescr+"/%")
	                                         select cs;
	                return tMark.ToList();
	            
	        }

        #endregion
    }
}
